local yingdui = fk.CreateSkill {
  name = "lingling__yingdui",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__yingdui"] = "影对",
  [":lingling__yingdui"] = "锁定技，当你受到伤害后，你获得一张不计入手牌上限的【影】。",
}

local U = require "packages/lingling/util"

yingdui:addEffect(fk.Damaged, {
  anim_type = "masochism",
  on_use = function (self, event, target, player, data)
    local room = player.room
    local card = U.getShade(room, 1)
    room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonJustMove, yingdui.name, nil, true, player, "lingling__yingdui-inhand")
  end,
})

yingdui:addEffect("maxcards", {
  exclude_from = function (self, player, card)
    return card:getMark("lingling__yingdui-inhand") > 0
  end,
})

return yingdui
